<?php
/**
 *  💡 免责声明：本软件不得用于商业用途，仅做学习交流
 *  ⚠️ 权利声明：本软件由版权人提供产品技术支持
 *  📅 项目编号：NX2025-0135
 */
namespace App\Api\Controllers\Commons;

use App\Api\BaseApi;
use App\Models\PointProduct;

class PointApi extends BaseApi
{
    public function pointProduct()
    {
        $res = PointProduct::query()
            ->select(['name', 'id', 'money', 'subtitle', 'main_image', 'sold_num', 'point_price', 'stock', 'bean_price', 'exchange_coupon'])
            ->simplePaginate(request('perPage', 10));
        return responses($res);
    }

    public function pointProductDetails()
    {
        $request = self::validate([
            'point_product_id' => 'required',
        ]);
        $res = PointProduct::query()->find($request->get('point_product_id'));
        return responses($res);
    }
}
